package pl.ptemich.tankwars.states;

import org.newdawn.slick.state.BasicGameState;

import pl.ptemich.tankwars.tools.StateTools;

public abstract class RegisteredState extends BasicGameState implements MenuPosition {

  private Integer stateId;
  
  @Override
  public final int getID() {   
    if (stateId == null) {
      stateId = StateTools.registerState(this);
    }
    return stateId;
  }  
  
  @Override
  public String getMenuPositionName() {
    return this.getClass().getSimpleName().replace("State", "");
  }
  
  @Override
  public Class<? extends RegisteredState> getStateTransition() {
    return this.getClass();
  }
  
}
